package com.example.pet.service;

import com.example.pet.hystrix.PetShowServiceHystrix;
import com.hj.pet.model.PetInfo;
import com.hj.pet.model.QueryCondition;
import com.hj.pet.model.ReturnT;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Component
@FeignClient(name = "pet-shop", fallback = PetShowServiceHystrix.class)
public interface PetShowService {
    @RequestMapping(value ="/internal/show/save",method = RequestMethod.POST)
    @ResponseBody
    public ReturnT<?> save(@RequestBody PetInfo petInfo);

    @RequestMapping(value ="/internal/show/updateById",method = RequestMethod.POST)
    @ResponseBody
    public ReturnT<?> updateById(@RequestBody PetInfo petInfo);

    @RequestMapping(value = "/internal/show/findPetById",method = RequestMethod.GET)
    @ResponseBody
    public ReturnT<?> findPetById(@RequestParam int petId);

    @RequestMapping(value = "/internal/show/findPetsByType",method = RequestMethod.GET)
    @ResponseBody
    public ReturnT<?> findPetsByType(@RequestParam String type);

    @RequestMapping(value = "/internal/show/findPetsByPrice",method = RequestMethod.GET)
    @ResponseBody
    public ReturnT<?> findPetsByPrice(@RequestParam Integer price1, @RequestParam Integer price2);

    @RequestMapping(value = "/internal/show/findPetsByUserAccount",method = RequestMethod.GET)
    @ResponseBody
    public ReturnT<?> findPetsByUserAccount(@RequestParam String user_account);

    @RequestMapping(value = "/internal/show/findPetsByPetName",method = RequestMethod.GET)
    @ResponseBody
    public ReturnT<?> findPetsByPetName(@RequestParam String pet_name);

    @RequestMapping(value = "/internal/show/delPetById",method = RequestMethod.DELETE)
    @ResponseBody
    public ReturnT<?> delPetById(@RequestParam int petId);

    @RequestMapping(value = "/internal/show/query",method = RequestMethod.GET)
    @ResponseBody
    public ReturnT<?> showList(@RequestBody QueryCondition queryCondition);

    @RequestMapping(value = "/internal/show/findAll",method = RequestMethod.GET)
    @ResponseBody
    public ReturnT<?> findAll();


}
